<?php
/**
 * This file is part of the Anota project.
 * 2011-2012 Fernando Garcia Huerta <fgarciahue@uoc.edu>
 * 
 * UOC - FUNDAMENTOS DE INFORMÁTICA EN ENTORNOS BIOINFORMÁTICOS - PEC2
 */

/**
 * DboSequence
 * 
 * Represents a row in sequences table
 * 
 * @package    Anota
 * @subpackage database
 * @author     Fernando Garcia Huerta <fgarciahue@uoc.edu>
 */
class DboSequence extends DboBase {

    public
    $id = null,         // id field
    $id_proc = null,    // id_proc field
    $length = null,     // length field
    $numgenes = null,   // numgenes field
    $numexons = null;   // numexons field

    /**
     * Constructor.
     * 
     * Fix name of the table.
     */
    public function __construct() {
        self::$TABLE = 'sequences';
    }
    
    /**
     * id Setter 
     * 
     * @param int $id 
     */
    protected function setId($id) {
        $this->id = $id;
    }
    
    /**
     * Returns sql insert query
     * 
     * @return string
     */
    protected function getInsertQuery() {
        $query = sprintf("INSERT INTO %s VALUES(NULL, '%s', '%s', '%s', '%s')", 
            DboProc::$TABLE, $this->id_proc, $this->length, $this->numgenes, $this->numexons);
        return $query;
    }

    /**
     * Not updatable
     * @return null
     */
    protected function getUpdateQuery() {
        return null;
    }
    
}